package com.baizhi.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class Banner implements Serializable {
    private Integer bannerId;

    private String bannerImageUrl;

    private String bannerOldName;

    private Integer bannerState;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date bannerDate;

    private String bannerDescription;

    private static final long serialVersionUID = 1L;

    public Integer getBannerId() {
        return bannerId;
    }

    public void setBannerId(Integer bannerId) {
        this.bannerId = bannerId;
    }

    public String getBannerImageUrl() {
        return bannerImageUrl;
    }

    public void setBannerImageUrl(String bannerImageUrl) {
        this.bannerImageUrl = bannerImageUrl == null ? null : bannerImageUrl.trim();
    }

    public String getBannerOldName() {
        return bannerOldName;
    }

    public void setBannerOldName(String bannerOldName) {
        this.bannerOldName = bannerOldName == null ? null : bannerOldName.trim();
    }

    public Integer getBannerState() {
        return bannerState;
    }

    public void setBannerState(Integer bannerState) {
        this.bannerState = bannerState;
    }

    public Date getBannerDate() {
        return bannerDate;
    }

    public void setBannerDate(Date bannerDate) {
        this.bannerDate = bannerDate;
    }

    public String getBannerDescription() {
        return bannerDescription;
    }

    public void setBannerDescription(String bannerDescription) {
        this.bannerDescription = bannerDescription == null ? null : bannerDescription.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Banner other = (Banner) that;
        return (this.getBannerId() == null ? other.getBannerId() == null : this.getBannerId().equals(other.getBannerId()))
            && (this.getBannerImageUrl() == null ? other.getBannerImageUrl() == null : this.getBannerImageUrl().equals(other.getBannerImageUrl()))
            && (this.getBannerOldName() == null ? other.getBannerOldName() == null : this.getBannerOldName().equals(other.getBannerOldName()))
            && (this.getBannerState() == null ? other.getBannerState() == null : this.getBannerState().equals(other.getBannerState()))
            && (this.getBannerDate() == null ? other.getBannerDate() == null : this.getBannerDate().equals(other.getBannerDate()))
            && (this.getBannerDescription() == null ? other.getBannerDescription() == null : this.getBannerDescription().equals(other.getBannerDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBannerId() == null) ? 0 : getBannerId().hashCode());
        result = prime * result + ((getBannerImageUrl() == null) ? 0 : getBannerImageUrl().hashCode());
        result = prime * result + ((getBannerOldName() == null) ? 0 : getBannerOldName().hashCode());
        result = prime * result + ((getBannerState() == null) ? 0 : getBannerState().hashCode());
        result = prime * result + ((getBannerDate() == null) ? 0 : getBannerDate().hashCode());
        result = prime * result + ((getBannerDescription() == null) ? 0 : getBannerDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bannerId=").append(bannerId);
        sb.append(", bannerImageUrl=").append(bannerImageUrl);
        sb.append(", bannerOldName=").append(bannerOldName);
        sb.append(", bannerState=").append(bannerState);
        sb.append(", bannerDate=").append(bannerDate);
        sb.append(", bannerDescription=").append(bannerDescription);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}